#define _CRT_SECURE_NO_WARNINGS
#include"list.h"

namespace my_list
{
	void test1()
	{
		list<int> v1(10, 1);
		print_container(v1);

		list<int> v2;
		v2.push_back(1);
		v2.push_back(2);
		v2.push_back(3);
		v2.push_back(4);
		v2.push_back(5);
		v2.pop_front();
		v2.push_front(6);
		print_container(v2);

		list<int> v3;
		v3.push_front(1);
		v3.push_front(2);
		v3.push_front(3);
		v3.push_front(4);
		v3.push_front(5);
		v3.pop_front();
		v3.push_front(6);

		print_container(v3);

		/*list<int> v4(v3.begin(), v3.end());
		print_container(v4);*/

		v1 = v3;
		print_container(v1);

		list<int> v4 = v2;
		print_container(v4);
		v4.clear();
		print_container(v4);

	}

	void test2()
	{
		list<int> v1;
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(3);
		v1.push_back(4);
		v1.push_back(5);

		print_container(v1);
		v1.insert(++v1.begin(), 10);
		v1.insert(--v1.end(), 10);
		v1.erase(--v1.end());
		v1.pop_front();

		print_container(v1);

	}

	struct AA
	{
		int _a1 = 1;
		int _a2 = 2;
	};

	/*void test3()
	{
		list<AA> lta;
		lta.push_back(AA());
		lta.push_back(AA());
		lta.push_back(AA());

		list<AA>::iterator it = lta.begin();
		while (it != lta.end())
		{
			cout << (*it)._a1 << " " << (*it)._a2 << endl;
		}
	}*/

}

int main()
{
	my_list::test2();
	return 0;
}